/**
 * label 模块名
 * img 模块图标
 * url 点击后跳转的页面
 * query 跳转页面时携带的参数
 * auth 模块权限
 * type 模块类型
 */
export const quickListLib = [
	{
		label: '建客户',
		img: 'images/home/quick_customer.png',
		url: '/pages_crm/customer/create',
		query: { type: 'customer' },
		auth: 'crm.customer.save',
		type: 'customer',
		typeNum: 1
	},
	{
		label: '建商机',
		img: 'images/home/quick_business.png',
		url: '/pages_crm/business/create',
		query: { type: 'business' },
		auth: 'crm.business.save',
		type: 'business',
		typeNum: 2
	},
	{
		label: '发任务',
		img: 'images/home/quick_task.png',
		url: '/pages_task/add',
		type: 'task',
		typeNum: 3
	},
	{
		label: '写日志',
		img: 'images/home/quick_log.png',
		url: '/pages_log/add',
		auth: 'oa.log',
		type: 'log',
		typeNum: 4
	},
	{
		label: '发审批',
		img: 'images/home/quick_examine.png',
		url: '/pages_examine/index',
		type: 'examine',
		typeNum: 5
	},
	{
		label: '建联系人',
		img: 'images/home/quick_contacts.png',
		url: '/pages_crm/contacts/create',
		query: { type: 'contacts' },
		type: 'contacts',
		typeNum: 6
	},
	{
		label: '建合同',
		img: 'images/home/quick_contract.png',
		url: '/pages_crm/contract/create',
		query: { type: 'contract' },
		type: 'contract',
		typeNum: 7
	},
	{
		label: '建线索',
		img: 'images/home/quick_leads.png',
		url: '/pages_crm/leads/create',
		query: { type: 'leads' },
		type: 'leads',
		typeNum: 8
	},
	{
		label: '建产品',
		img: 'images/home/quick_product.png',
		url: '/pages_crm/product/create',
		query: { type: 'product' },
		type: 'product',
		typeNum: 9
	},
	{
		label: '建回款',
		img: 'images/home/quick_receivables.png',
		url: '/pages_crm/receivables/create',
		query: { type: 'receivables' },
		type: 'receivables',
		typeNum: 10
	},
	{
		label: '建外勤',
		img: 'images/home/quick_legwork.png',
		url: '/pages_oa/legwork/add',
		type: 'legwork',
		typeNum: 11
	},
	{
		label: '建公告',
		img: 'images/home/quick_announcement.png',
		url: '/pages_oa/notice/add',
		type: 'announcement',
		typeNum: 12
	}
]

export const crmLibList = [
	{
		label: '线索',
		icon: 'images/application/leads.png',
		auth: 'crm.leads',
		url: '/pages_crm/leads/index',
		type: 'leads',
		typeNum: 1
	},
	{
		label: '客户',
		icon: 'images/application/customer.png',
		auth: 'crm.customer',
		url: '/pages_crm/customerAndContacts/index?type=list&&index=0',
		type: 'customer',
		typeNum: 2
	},
	{
		label: '公海',
		icon: 'images/application/pool.png',
		auth: 'crm.pool',
		url: '/pages_crm/seas/index',
		type: 'pool',
		typeNum: 3
	},
	{
		label: '联系人',
		icon: 'images/application/contacts.png',
		auth: 'crm.contacts',
		url: '/pages_crm/customerAndContacts/index?type=list&&index=1',
		type: 'contacts',
		typeNum: 4
	},
	{
		label: '附近客户',
		icon: 'images/application/nearby.png',
		auth: 'crm.customer.nearbyCustomer',
		url: '/pages_crm/nearby/index',
		type: 'nearbyCustomer',
		typeNum: 5
	},
	{
		label: '商机',
		icon: 'images/application/business.png',
		auth: 'crm.business',
		url: '/pages_crm/business/index?type=list',
		type: 'business',
		typeNum: 6
	},
	{
		label: '产品',
		icon: 'images/application/product.png',
		auth: 'crm.product',
		url: '/pages_crm/product/index',
		type: 'product',
		typeNum: 7
	},
	{
		label: '合同',
		icon: 'images/application/contract.png',
		auth: 'crm.contract',
		url: '/pages_crm/contract/index',
		type: 'contract',
		typeNum: 8
	},
	{
		label: '回款',
		icon: 'images/application/receivables.png',
		auth: 'crm.receivables',
		url: '/pages_crm/receivables/index',
		type: 'receivables',
		typeNum: 9
	},
	{
		label: '发票',
		icon: 'images/application/invoice.png',
		auth: 'crm.invoice',
		url: '/pages_crm/invoice/index',
		type: 'invoice',
		typeNum: 18
	},
	{
		label: '商城',
		icon: 'images/application/shop.png',
		auth: 'crm.shop',
		url: '/pages_crm/shop/index',
		type: 'shop',
		typeNum: 19
	}
]

export const oaLibList = [
	{
		label: '公告',
		icon: 'images/application/announcement.png',
		auth: '',
		url: '/pages_oa/notice/index',
		type: 'announcement',
		typeNum: 10
	},
	{
		label: '待办',
		icon: 'images/application/remind.png',
		auth: '',
		url: '/pages_message/backlogIndex',
		type: 'backlog',
		typeNum: 11
	},
	{
		label: '任务',
		icon: 'images/application/task.png',
		auth: 'oa.taskExamine',
		url: '/pages_task/index',
		type: 'task',
		typeNum: 12
	},
	{
		label: '日志',
		icon: 'images/application/worklog.png',
		auth: 'oa.log',
		url: '/pages_log/index',
		type: 'log',
		typeNum: 13
	},
	{
		label: '通讯录',
		icon: 'images/application/address_book.png',
		auth: 'oa.book',
		url: '/pages_oa/concat/index',
		type: 'book',
		typeNum: 14
	},
	{
		label: '审批',
		icon: 'images/application/examine.png',
		auth: 'oa.taskExamine',
		url: '/pages_examine/index',
		type: 'examine',
		typeNum: 15
	},
	{
		label: '外勤签到',
		icon: 'images/application/sign_in.png',
		auth: 'crm.outwork.read',
		url: '/pages_oa/legwork/index',
		type: 'legwork',
		typeNum: 16
	},
	{
		label: '跟进记录',
		icon: 'images/application/follow.png',
		auth: 'crm.followRecord.read',
		url: '/pages_oa/record/index',
		type: 'record',
		typeNum: 17
	}
]

// 2024/8/1 @description:添加注释 这是和导航栏相关的变量 typeNum不要随意修改
export const navLibList = [
	{
		name: '首页',
		icon: 'ft ft-home',
		active_icon: 'ft ft-home-fill',
		path: '/pages/home/index',
		typeNum: 1
	},
	{
		name: '客户',
		icon: 'ft ft-customer',
		active_icon: 'ft ft-customer-fill',
		path: '/pages_crm/customerAndContacts/index',
		typeNum: 2
	},
	{
		name: '商机',
		icon: 'ft ft-business',
		active_icon: 'ft ft-business-fill',
		path: '/pages_crm/business/index',
		typeNum: 3
	},
	{
		name: '消息',
		icon: 'ft ft-news',
		active_icon: 'ft ft-news-fill',
		path: '/pages_message/index',
		typeNum: 4
	},
	{
		name: '产品',
		icon: 'ft ft-product',
		active_icon: 'ft ft-product-fill',
		path: '/pages_crm/product/index',
		typeNum: 5
	},
	{
		name: '线索',
		icon: 'ft ft-clue',
		active_icon: 'ft ft-clue-fill',
		path: '/pages_crm/leads/index',
		typeNum: 6
	},
	{
		name: '公海',
		icon: 'ft ft-international',
		active_icon: 'ft ft-international-fill',
		path: '/pages_crm/seas/index',
		typeNum: 7
	},
	{
		name: '合同',
		icon: 'ft ft-contract',
		active_icon: 'ft ft-contract-fill',
		path: '/pages_crm/contract/index',
		typeNum: 8
	},
	// {
	// 	name: '外勤',
	// 	icon: 'ft ft-legwork',
	// 	active_icon: 'ft ft-legwork-fill',
	// 	path: '',
	// 	typeNum: 9
	// },
	{
		name: '回款',
		icon: 'ft ft-return',
		active_icon: 'ft ft-return-fill',
		path: '/pages_crm/receivables/index',
		typeNum: 10
	},
	{
		name: '任务',
		icon: 'ft ft-task',
		active_icon: 'ft ft-task-fill',
		path: '/pages_task/index',
		typeNum: 11
	},
	{
		name: '我的',
		icon: 'ft ft-my',
		active_icon: 'ft ft-my-fill',
		path: '/pages/application/index',
		typeNum: 12,
		badge: 0,
		disabled: true
	},
	{
		name: '人力',
		icon: 'ft ft-employee',
		active_icon: 'ft ft-employee-fill',
		path: '/pages_hrm/performance/index',
		typeNum: 13,
		// badge: 0, 此处badge 必须去掉 因为badge是代表待办事项提醒 只有 导航栏 我的 才需要在导航名称 右上方 显示 小红点 代表 有待处理事项：未读消息、待办事项
		// 2024/8/1 @description:所有用户 默认的个性化导航栏设置中 至少有导航栏： 12--我的 13--人力 所以此导航禁止去除 设置disabled=true
		disabled: true
	}
]

export function getQuickList(typeArr) {
	const res = []
	typeArr.forEach(type => {
		const findRes = quickListLib.find(o => o.typeNum === type)
		if (findRes) {
			res.push(findRes)
		}
	})
	return res
}

export function getCommonNavList(typeArr) {
	const res = []
	typeArr.forEach(type => {
		let findRes = crmLibList.find(o => o.typeNum === type)
		if (findRes) {
			res.push(findRes)
		} else {
			findRes = oaLibList.find(o => o.typeNum === type)
			if (findRes) {
				res.push(findRes)
			}
		}
	})
	return res
}

export function getNavList(typeArr) {
	const res = []
	typeArr.forEach(type => {
		const findRes = navLibList.find(o => o.typeNum === type)
		if (findRes) {
			res.push(findRes)
		}
	})
	return res
}

export const timeOptions = [
	{ label: '今天', value: 'today' },
	{ label: '昨天', value: 'yesterday' },
	{ label: '明天', value: 'tomorrow' },
	{ label: '本周', value: 'week' },
	{ label: '上周', value: 'lastWeek' },
	{ label: '下周', value: 'nextWeek' },
	{ label: '本月', value: 'month' },
	{ label: '上月', value: 'lastMonth' },
	{ label: '下月', value: 'nextMonth' },
	{ label: '本季度', value: 'quarter' },
	{ label: '上一季度', value: 'lastQuarter' },
	{ label: '下一季度', value: 'nextQuarter' },
	{ label: '本年度', value: 'year' },
	{ label: '上一年度', value: 'lastYear' },
	{ label: '下一年度', value: 'nextYear' },
	{ label: '自定义', value: 'custom' }
]

export const largeTimeOptions = [
	{ label: '本年度', value: 'year' },
	{ label: '上一年度', value: 'lastYear' },
	{ label: '下一年度', value: 'nextYear' },
	{ label: '上半年', value: 'firstHalfYear' },
	{ label: '下半年', value: 'nextHalfYear' },
	{ label: '本季度', value: 'quarter' },
	{ label: '上一季度', value: 'lastQuarter' },
	{ label: '下一季度', value: 'nextQuarter' },
	{ label: '本月', value: 'month' },
	{ label: '上月', value: 'lastMonth' },
	{ label: '下月', value: 'nextMonth' },
	{ label: '本周', value: 'week' },
	{ label: '上周', value: 'lastWeek' },
	{ label: '下周', value: 'nextWeek' },
	{ label: '今天', value: 'today' },
	{ label: '昨天', value: 'yesterday' },
	{ label: '明天', value: 'tomorrow' },
	{ label: '过去7天', value: 'previous7day' },
	{ label: '过去30天', value: 'previous30day' },
	{ label: '未来7天', value: 'future7day' },
	{ label: '未来30天', value: 'future30day' },
	{ label: '自定义', value: -1 }
]
